﻿#pragma once
#include <cuda_runtime.h>

// CUDA 检查错误的宏
#define MYCHECK(call)                                                                                             \
    {                                                                                                             \
        cudaError_t error = call;                                                                                 \
        if (error != cudaSuccess)                                                                                 \
        {                                                                                                         \
            fprintf(stderr, "CUDA error: %s file: %s line: %d\n", cudaGetErrorString(error), __FILE__, __LINE__); \
            throw std::runtime_error("CUDA operation failed");                                                    \
        }                                                                                                         \
    }
